/**
 * All rights Reserved
 *
 * @Title: GoodsDaoImpl.java
 * @Package com.amigo.online.provider.merchant.mongo.dao.impl
 * @Description: (用一句话描述该文件做什么)
 * @author: zxy  QQ:1363320658
 * @date: 2018年12月17日 下午5:10:24
 * @version V1.0
 * @Copyright: 2018  All rights reserved.
 */
package com.amigo.online.provider.merchant.mongo.dao.impl;

import java.util.List;

import org.bson.Document;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import com.amigo.online.provider.merchant.mongo.dao.GoodsDao;
import com.mongodb.BasicDBObject;
import com.mongodb.client.AggregateIterable;

/**
 * @version: V 1.0.0
 * @Description: （） 
 * @author: zxy  QQ:1363320658
 * @date: 2018年12月17日 下午5:10:24  
 *
 */
@Service
public class GoodsDaoImpl implements GoodsDao {

//	@Autowired
//	@Qualifier("readGoodsMongoTemplate")
//    MongoTemplate readMongoTemplate;


    @Override
    public AggregateIterable<Document> findAroundGoods(String collection, Double[] point, int searchMaxdistance,
                                                       BasicDBObject query, List<BasicDBObject> pipeline) {
//		BasicDBObject aggregate = new BasicDBObject("$geoNear",
//				new BasicDBObject("near",
//						new BasicDBObject("type", "Point").append("coordinates",point))
//				                        .append("distanceField", "distance")
//										.append("query", query)
//										.append("maxDistance", searchMaxdistance).append("spherical", true));
//		pipeline.add(0, aggregate);       
//		AggregateIterable<Document> iterators = readMongoTemplate.getCollection(collection).aggregate(pipeline);	
//		return iterators;
        return null;
    }
}
